<!---->
<template>
    <div class="page_addmember">
        <common-header :title="'添加居民信息'" :showBack="true"></common-header>
        <div class="btn-save" @click="saveInfo">保存</div>
        <div class="pages-main" style="height: calc( 100vh - 45px)">
            <div class="item-info">
                <div class="item-item">
                    <x-input title="姓名" v-model="info.name"
                             placeholder="仅限汉字">
                    </x-input>
                </div>
                <div class="item-item">
                    <x-input title="身份证" v-model="info.idcardnumber"
                             placeholder="请输入身份证">
                    </x-input>
                </div>

                <div class="item-item every-block-padding">
                    <span class="item-itemLabel">性别</span>
                    <div class="translateBlock"
                         style="float: right;text-align: right;;width: 8.2rem;font-size:0.38rem;">
                        <label style="margin-right:10%;">
                            <input type="radio" name="gender" v-model="info.gender" :value="1">
                            男
                        </label>
                        <label>
                            <input type="radio" name="gender" v-model="info.gender" :value="2">
                            女
                        </label>
                    </div>
                </div>
                <div class="item-item">
                    <datetime title="出生日期" :min-year="1900" placeholder="请选择出生日期" v-model="birthday"></datetime>
                </div>
            </div>

            <div class="baseInfo">
                <tab>
                    <tab-item selected @on-item-click="onItemClick">必填项</tab-item>
                    <tab-item @on-item-click="onItemClick">选填项</tab-item>
                </tab>

                <div v-show="isMustFill">
                    <div class="item-info">
                        <div class="item-item">
                            <div class="item-item every-block-padding item-inline">
                                <span class="item-itemLabel">婚姻状况</span>
                                <select class="translateBlock" v-model="info.hadmarried"
                                        style="text-align-last: right;;width: 7.2rem;font-size:0.38rem;">
                                    <option :value="0">未婚</option>
                                    <option :value="1">已婚</option>
                                </select>
                            </div>
                        </div>
                        <div class="item-item">
                            <div class="item-item every-block-padding item-inline">
                                <span class="item-itemLabel">是否户主</span>
                                <select class="translateBlock" v-model="info.ismaster"
                                        style="text-align-last: right;;width: 7.2rem;font-size:0.38rem;">
                                    <option :value="0">否</option>
                                    <option :value="1">是</option>
                                </select>
                            </div>
                        </div>
                        <div v-if="!info.ismaster" style="border-bottom: 1px solid #f4f4f4;">
                            <x-input title="与户主关系" v-model="info.relation"
                                     placeholder="请输入与户主的关系">
                            </x-input>
                        </div>
                        <div class="item-item">
                            <div class="item-item every-block-padding item-inline">
                                <span class="item-itemLabel">文化程度</span>
                                <select class="translateBlock" v-model="info.degree" placeholder="请选择文化程度"
                                        style="text-align-last: right;width: 7.2rem;font-size:0.38rem;">
                                    <option :value="'小学及以下'">小学及以下</option>
                                    <option :value="'初中'">初中</option>
                                    <option :value="'高中'">高中</option>
                                    <option :value="'专科'">专科</option>
                                    <option :value="'本科'">本科</option>
                                    <option :value="'双学士'">双学士</option>
                                    <option :value="'硕士'">硕士</option>
                                    <option :value="'博士'">博士</option>
                                    <option :value="'其他'">其他</option>
                                </select>
                            </div>
                        </div>
                        <div class="item-item">
                            <div class="item-item every-block-padding item-inline">
                                <span class="item-itemLabel">政治面貌</span>
                                <select class="translateBlock" v-model="info.politicalclimate"
                                        style="text-align-last: right;;width: 7.2rem;font-size:0.38rem;">
                                    <option :value="'群众'">群众</option>
                                    <option :value="'团员'">团员</option>
                                    <option :value="'党员'">党员</option>
                                </select>
                            </div>
                        </div>
                        <div class="item-item">
                            <div class="item-item every-block-padding item-inline">
                                <span class="item-itemLabel">民族</span>
                                <select class="translateBlock" v-model="info.nation"
                                        style="text-align-last: right;;width: 8rem;font-size:0.38rem;">
                                    <option v-for="item in Ethnic" :value="item" :key="item">{{item}}</option>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>

                <div v-show="!isMustFill">
                    <div class="every-info">
                        <div class="info-title">
                            <div class=" every-block-padding">
                                <img src="../../../static/images/edit.png" alt="" @click="addInfo('option')"/>
                                <div class="title-text translateBlock">个人基本信息</div>
                                <img v-if="isOpenBaseInfoChildren" src="../../../static/images/down-arrow.png"
                                     @click="isOpenBaseInfoChildren = !isOpenBaseInfoChildren"/>
                                <img v-else src="../../../static/images/up-arrow.png"
                                     @click="isOpenBaseInfoChildren = !isOpenBaseInfoChildren"/>
                            </div>
                        </div>
                        <div class="item-info" v-show="isOpenBaseInfoChildren">
                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">户籍派出所</span>
                                <span class="translateBlock" style="width: 7rem;text-align: right;line-height:
                                0.5rem;">{{memberInfo.policename}}
                                </span>
                            </div>
                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">曾用名</span>
                                <span class="float-right">{{memberInfo.formername}}</span>
                            </div>
                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">手机号</span>
                                <span class="float-right">{{memberInfo.contractphone}}</span>
                            </div>
                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">固话号码</span>
                                <span class="float-right">{{memberInfo.telephone}}</span>
                            </div>
                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">电子邮箱</span>
                                <span class="float-right">{{memberInfo.email}}</span>
                            </div>
                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">职业</span>
                                <span class="translateBlock"
                                      style="width: 8.25rem;text-align: right;line-height: 0.5rem;">{{memberInfo.job}}
                                </span>
                            </div>
                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">工作单位</span>
                                <span class="translateBlock"
                                      style="width: 7.4rem;text-align: right;line-height: 0.5rem;">
                                    {{memberInfo.companyname}}
                                </span>
                            </div>
                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">就读学校</span>
                                <span class="translateBlock"
                                      style="width: 7.4rem;text-align: right;line-height: 0.5rem;">{{memberInfo.school}}
                                </span>
                            </div>
                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">身高（cm）</span>
                                <span class="float-right">{{memberInfo.high}}</span>
                            </div>
                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">血型</span>
                                <span class="float-right">{{memberInfo.bloodgroup}}</span>
                            </div>
                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">宗教信仰</span>
                                <span class="float-right">{{memberInfo.religiousbelief}}</span>
                            </div>
                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">居住地址</span>
                                <span class="translateBlock"
                                      style="width: 7.42rem;text-align: right;line-height: 0.5rem;">
                                    {{memberInfo.address}}
                                </span>
                            </div>
                        </div>
                    </div>

                    <div class="every-info">
                        <div class="info-title">
                            <div class=" every-block-padding">
                                <img src="../../../static/images/icon-add.png" @click="addInfo('special')" alt=""/>
                                <div class="title-text translateBlock">特殊人群</div>
                                <img v-if="isOpenSpecialInfoChildren" src="../../../static/images/down-arrow.png"
                                     @click="isOpenSpecialInfoChildren = !isOpenSpecialInfoChildren"/>
                                <img v-else src="../../../static/images/up-arrow.png"
                                     @click="isOpenSpecialInfoChildren = !isOpenSpecialInfoChildren"/>
                            </div>
                        </div>
                        <div class="item-info" v-show="isOpenSpecialInfoChildren">
                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">刑释人员</span>
                                <span class="float-right"> {{specialInfo.interpretationinterpretation == '1' ? '是' :
                                    '否'}}
                                </span>
                            </div>
                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">精神病人员</span>
                                <span class="float-right">{{specialInfo.mentaldisease == '1' ? '是' : '否'}}</span>
                            </div>

                            <div v-show="specialInfo.mentaldisease == '1' ">
                                <div class="item-item every-block-padding">
                                    <span class="item-itemLabel">危险程度</span>
                                    <span class="float-right">{{specialInfo.dangerleave}}</span>
                                </div>
                                <div class="item-item every-block-padding">
                                    <span class="item-itemLabel">精神病类型</span>
                                    <span class="float-right">{{specialInfo.mentaltype}}</span>
                                </div>
                                <div class="item-item every-block-padding">
                                    <span class="item-itemLabel">患病名称</span>
                                    <span class="translateBlock"
                                          style="width: 7.42rem;text-align: right;line-height: 0.5rem;">
                                        {{specialInfo.mentalname}}
                                    </span>
                                </div>
                                <div class="item-item every-block-padding">
                                    <span class="item-itemLabel">是否接受过治疗</span>
                                    <span class="float-right">{{specialInfo.hadtreat == '1' ? '是' : '否'}}</span>
                                </div>
                                <div class="item-item every-block-padding">
                                    <span class="item-itemLabel">目前是否正在接受治疗</span>
                                    <span class="float-right">{{specialInfo.istreating == '1' ? '是' : '否'}}</span>
                                </div>
                                <div class="item-item every-block-padding">
                                    <span class="item-itemLabel">发病时间</span>
                                    <span class="float-right">{{specialInfo.mentalbegintime}}</span>
                                </div>
                            </div>

                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">吸毒人员</span>
                                <span class="float-right">{{specialInfo.isdrug == '1' ? '是' : '否'}}</span>
                            </div>
                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">危险品从业人员</span>
                                <span class="float-right">{{specialInfo.ishazardousperson == '1' ? '是' : '否'}}</span>
                            </div>
                            <div class="item-item every-block-padding">
                                <span class="item-itemLabel">重点上访人员</span>
                                <span class="float-right">{{specialInfo.isimportvisitors == '1' ? '是' : '否'}}</span>
                            </div>
                        </div>
                    </div>

                    <div class="every-info">
                        <div class="info-title">
                            <div class=" every-block-padding">
                                <img src="../../../static/images/icon-add.png" style="visibility: hidden;" alt=""/>
                                <div class="title-text translateBlock">综合信访</div>
                                <img v-if="isOpenVisitedInfoChildren" src="../../../static/images/down-arrow.png"
                                     @click="isOpenVisitedInfoChildren = !isOpenVisitedInfoChildren"/>
                                <img v-else src="../../../static/images/up-arrow.png"
                                     @click="isOpenVisitedInfoChildren = !isOpenVisitedInfoChildren"/>

                            </div>
                        </div>
                        <div v-show="isOpenVisitedInfoChildren">
                            <div>
                                <div class="info-title">
                                    <div class="every-block-padding">
                                        <img src="../../../static/images/icon-add.png" @click="addInfo('petition')"
                                             alt=""/>
                                        新增上访记录
                                    </div>
                                </div>

                                <div v-for="item in  visitedInfoList"
                                     class="every-block-bgcolor item-issue every-block-padding">
                                    <div>上访时间：{{item.visitedtime}}</div>
                                    <div>上访单位：{{item.visitedorg}}</div>
                                    <div class="item-btns">
                                        <div class="translateBlock item-btn" @click="addInfo('petition',item)">
                                            <img src="../../../static/images/bj_03.png" alt="" width="16"/>
                                            编辑
                                        </div>
                                        <div class="translateBlock" @click="deleteInfo('petition',item)">
                                            <img src="../../../static/images/del_03.png" alt="" width="16"/>
                                            删除
                                        </div>
                                    </div>
                                </div>

                            </div>
                            <div>
                                <div class="info-title">
                                    <div class="every-block-padding">
                                        <img src="../../../static/images/icon-add.png" @click="addInfo('dispute')"
                                             alt=""/>
                                        新增纠纷记录
                                    </div>
                                </div>
                                <div v-for="item in issueInfoList"
                                     class="every-block-bgcolor item-issue every-block-padding">
                                    <div>
                                        <div class="translateBlock">纠纷时间：{{item.issuetime}}</div>
                                        <div class="translateBlock" style="margin-left: 1rem;">是否已调解：{{item.ismediate ==
                                            '1' ? '是' : '否'}}
                                        </div>
                                    </div>
                                    <div class="item-btns">
                                        <div class="translateBlock item-btn" @click="addInfo('dispute',item)">
                                            <img src="../../../static/images/bj_03.png" alt="" width="16"/>
                                            编辑
                                        </div>
                                        <div class="translateBlock" @click="deleteInfo('dispute',item)">
                                            <img src="../../../static/images/del_03.png" alt="" width="16"/>
                                            删除
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>

                    <div class="every-info">
                        <div class="info-title">
                            <div class=" every-block-padding">
                                <img src="../../../static/images/icon-add.png" @click="addInfo('subsidy')" alt=""/>
                                <div class="title-text translateBlock">惠民政策及措施</div>
                                <img v-if="isOpensubsidyInfoChildren" src="../../../static/images/down-arrow.png"
                                     @click="isOpensubsidyInfoChildren = !isOpensubsidyInfoChildren"/>
                                <img v-else src="../../../static/images/up-arrow.png"
                                     @click="isOpensubsidyInfoChildren = !isOpensubsidyInfoChildren"/>
                            </div>
                            <div v-show="isOpensubsidyInfoChildren">
                                <div v-for="item in subsidyInfoList"
                                     class="every-block-bgcolor item-issue every-block-padding">
                                    <div>补贴类型：{{item.typename}}</div>
                                    <div>补贴金额：{{item.amount}}</div>
                                    <div>
                                        <div class="translateBlock" style="margin-right: 1rem;">
                                            是否发放：{{item.sendstatus==1?'是':'否'}}
                                        </div>
                                        <div class="translateBlock">发放时间：{{item.sendtime}}</div>
                                    </div>
                                    <div class="item-btns">
                                        <div class="translateBlock item-btn" @click="addInfo('subsidy',item)">
                                            <img src="../../../static/images/bj_03.png" alt="" width="16"/>
                                            编辑
                                        </div>
                                        <div class="translateBlock" @click="deleteInfo('subsidy',item)">
                                            <img src="../../../static/images/del_03.png" alt="" width="16"/>
                                            删除
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

            <div v-transfer-dom>
                <confirm v-model="isShowDeleteDialog"
                         :title="'确认删除框'"
                         @on-cancel="onCancel"
                         @on-confirm="onConfirm">
                    <p style="text-align:center;">您确定要删除该数据吗？</p>
                </confirm>
            </div>
        </div>

    </div>
</template>

<script>
    import {XInput, Tab, TabItem, Datetime} from 'vux'
    import resident from '../../services/resident'

    export default {
        name: "addmember",
        components: {
            XInput,
            Tab,
            TabItem,
            Datetime
        },
        data() {
            return {
                kid: '',
                birthday: '',
                deleteId: '',
                isShowDeleteDialog: false,
                familyId: this.$route.query.familyid,
                populationId: this.$route.query.populationId,
                isOpensubsidyInfoChildren: false,
                isOpenVisitedInfoChildren: false,
                info: {
                    familyid: this.$route.query.familyid,
                    name: '',
                    idcardnumber: '',
                    gender: '',
                    birthday: '',
                    hadmarried: 0,
                    ismaster: 0,
                    relation: '',
                    degree: '小学及以下',
                    nation: '汉族',
                    politicalclimate: '群众',
                },
                isMustFill: true,
                Ethnic: ["汉族", "阿昌族", "白族", "保安族", "布朗族", "布依族", "朝鲜族", "达斡尔族", "傣族", "德昂族", "侗族", "东乡族", "独龙族", "鄂伦春族", "俄罗斯族", "鄂温克族", "高山族", "仡佬族", "哈尼族", "哈萨克族", "赫哲族", "回族", "基诺族", "京族", "景颇族", "柯尔克孜族", "拉祜族", "黎族", "傈僳族", "珞巴族", "满族", "毛南族", "门巴族", "蒙古族", "苗族", "仫佬族", "纳西族", "怒族", "普米族", "羌族", "撒拉族", "畲族", "水族", "塔吉克族", "塔塔尔族",
                    "土族", "土家族", "佤族", "维吾尔族", "乌兹别克族", "锡伯族", "瑶族", "彝族", "裕固族", "藏族", "壮族"
                ],
                isOpenBaseInfoChildren: true,
                isOpenSpecialInfoChildren: false,
                isOpenAccordionInfoChildren: false,
                memberInfo: {
                    policename: '',
                    formername: '',
                    contractphone: '',
                    telephone: '',
                    email: '',
                    job: '',
                    school: '',
                    bloodgroup: '',
                    religiousbelief: '',
                    address: '',
                    high: '',
                    companyname: '',
                },
                specialInfo: {
                    interpretationinterpretation: '',
                    mentaldisease: '',
                    dangerleave: '',
                    mentaltype: '',
                    mentalname: '',
                    hadtreat: '',
                    istreating: '',
                    mentalbegintime: '',
                    isdrug: '',
                    ishazardousperson: '',
                    isimportvisitors: '',
                },
                issueInfoList: [],     // 纠纷记录列表
                visitedInfoList: [],     // 上访记录列表
                subsidyInfoList: [],     // 上访记录列表
            }
        },

        mounted() {
            if (this.populationId) {
                this.getPopulationInfo()
                this.getIssueInfoList();
                this.getVisitedInfoList();
                this.getSubsidyInfoList()
            }
        },
        watch: {},
        methods: {

            //获取居民信息
            getPopulationInfo() {
                let _param = this.$tools.invokeUAF('resident/getPopulationInfo', {
                    populationId: this.populationId,
                })
                resident.getPopulationInfo(_param).then(res => {
                    let data = res.data.data;
                    if (res.data.code === '0') {
                        for (let i in this.info) {
                            if (i === 'birthday') {
                                this.birthday = data.memberInfo[i]
                            } else {
                                this.info[i] = data.memberInfo[i];
                            }

                        }
                        for (let i in this.specialInfo) {
                            this.specialInfo[i] = data.memberInfo[i];
                        }
                        for (let i in this.memberInfo) {
                            this.memberInfo[i] = data.memberInfo[i];
                        }
                        this.info = Object.assign(this.info, {id: data.memberInfo.id})
                    }
                })
            },

            // 获取纠纷纪录
            getIssueInfoList() {

                let _param = this.$tools.invokeUAF('resident/getIssueInfoListByPopulationId', {
                    populationId: this.populationId,
                })
                resident.getIssueInfoList(_param).then(res => {
                    let data = res.data.data;
                    this.issueInfoList = data;
                })
            },

            // 获取上访记录
            getVisitedInfoList() {
                let _param = this.$tools.invokeUAF('resident/getVisitedInfoListByPopulationId', {
                    populationId: this.populationId,
                })
                resident.getVisitedInfoList(_param).then(res => {
                    let data = res.data.data;
                    this.visitedInfoList = data;
                })
            },

            // 获取补贴记录
            getSubsidyInfoList() {
                let _param = this.$tools.invokeUAF('subsidyinfo/getSubsidyInfoListByPopulationId', {
                    populationId: this.populationId,
                })
                resident.getSubsidyInfoList(_param).then(res => {
                    let data = res.data.data;
                    this.subsidyInfoList = data;
                })
            },

            // 保存信息
            saveInfo() {

                let param = {
                    name: '请输入姓名',
                    idcardnumber: '请输入身份证号',
                    gender: '请选择性别',
                    birthday: '请选择出生日期',
                    degree: '请选择文化程度',
                    politicalclimate: '请选择政治面貌',
                    nation: '请选择民族',
                }

                for (let i in param) {
                    if (i === 'birthday') {
                        if (!this.birthday) {
                            this.$vux.toast.show({
                                text: param[i],
                                type: 'text',
                                position: 'middle',
                            })
                            return;
                        }
                    } else {
                        if (!this.info[i]) {
                            this.$vux.toast.show({
                                text: param[i],
                                type: 'text',
                                position: 'middle',
                            })
                            return;
                        }
                    }
                }

                this.info.birthday = this.birthday + ' ' + '00:00:00';
                this.info.hadmarried = this.info.hadmarried ? 1 : 0;
                let _param = this.$tools.invokeUAF('resident/savePopulationBaseInfo', this.info)
                resident.savePopulationBaseInfo(_param).then(res => {
                    let data = res.data.data;
                    if (res.data.code === '0') {
                        this.info.id = data.id;
                        this.populationId = data.id;
                        // this.getPopulationInfo()

                        this.$tools.goPage_query('addmember',{
                            familyid:this.familyId,
                            populationId:this.populationId,
                        })
                    }

                })
            },

            //
            onItemClick(index) {
                this.isMustFill = !index ? true : false;
            },

            // 添加基本信息
            addInfo(param, item) {
                console.log(this.familyId,21111)
                if (!this.populationId) {
                    this.$vux.toast.show({
                        text: '请先填写用户基本信息',
                        type: 'text',
                        position: 'middle',
                    })
                    return;
                } else {
                    switch (param) {
                        case 'option':
                            this.$tools.goPage_query('memberOptionInfo', {
                                familyid: this.familyId,
                                id: this.populationId,
                                policename: this.memberInfo.policename,
                                formername: this.memberInfo.formername,
                                contractphone: this.memberInfo.contractphone,
                                telephone: this.memberInfo.telephone,
                                email: this.memberInfo.email,
                                job: this.memberInfo.job,
                                school: this.memberInfo.school,
                                bloodgroup: this.memberInfo.bloodgroup,
                                religiousbelief: this.memberInfo.religiousbelief,
                                address: this.memberInfo.address,
                                companyname: this.memberInfo.companyname,
                                high: this.memberInfo.high,
                            })
                            break;
                        case  'special':
                            this.$tools.goPage_query('memberSpecialInfo', {
                                familyid: this.familyId,
                                id: this.populationId,
                                interpretationinterpretation: this.specialInfo.interpretationinterpretation,
                                mentaldisease: this.specialInfo.mentaldisease,
                                dangerleave: this.specialInfo.dangerleave,
                                mentaltype: this.specialInfo.mentaltype,
                                mentalname: this.specialInfo.mentalname,
                                hadtreat: this.specialInfo.hadtreat,
                                istreating: this.specialInfo.istreating,
                                mentalbegintime: this.specialInfo.mentalbegintime,
                                isdrug: this.specialInfo.isdrug,
                                ishazardousperson: this.specialInfo.ishazardousperson,
                                isimportvisitors: this.specialInfo.isimportvisitors,
                            })
                            break;
                        case 'petition':
                            if (item) {
                                this.$tools.goPage_query('petition', {
                                    familyid: this.familyId,
                                    visitedid: item.visitedid,
                                    id: item.id,
                                    visitedtime: item.visitedtime,
                                    visitedorg: item.visitedorg,
                                    visitedreason: item.visitedreason,
                                    measures: item.measures,
                                    hasnext: item.hasnext,
                                })
                                break;
                            } else {
                                this.$tools.goPage_query('petition', {
                                    familyid: this.familyId,
                                    visitedid: this.populationId,
                                })
                            }

                            break;
                        case 'dispute':
                            if (item) {
                                this.$tools.goPage_query('dispute', {
                                    familyid: this.familyId,
                                    issuepersonid: item.issuepersonid,
                                    id: item.id,
                                    issuetime: item.issuetime,
                                    issuedescription: item.issuedescription,
                                    ismediate: item.ismediate,
                                })
                                break;
                            } else {
                                this.$tools.goPage_query('dispute', {
                                    familyid: this.familyId,
                                    issuepersonid: this.populationId,
                                })
                                break;
                            }
                        case 'subsidy':
                            if (item) {
                                this.$tools.goPage_query('subsidy', {
                                    familyid: this.familyId,
                                    id: this.populationId,
                                    itemId: item.id,
                                    typeid: item.typeid,
                                    typename: item.typename,
                                    hadjoin: item.hadjoin,
                                    amount: item.amount,
                                    sendstatus: item.sendstatus,
                                    sendtime: item.sendtime,
                                    receiveaccount: item.receiveaccount,
                                    criterion: item.criterion,
                                    remarks: item.remarks,
                                })
                                break;
                            } else {
                                debugger
                                console.log(this.familyId,2222)
                                this.$tools.goPage_query('subsidy', {
                                    familyid: this.familyId,
                                    id: this.populationId,
                                })
                                break;
                            }
                    }

                }
            },

            // 删除纠纷记录，上访记录
            deleteInfo(kid, item) {
                this.isShowDeleteDialog = true;
                this.kid = kid;
                this.deleteId = item.id;
            },

            onCancel() {
                this.isShowDeleteDialog = false;
                this.kid = '';
                this.deleteId = '';
            },

            onConfirm() {
                if (this.kid === 'petition') {
                    let _param = this.$tools.invokeUAF('resident/deleteVisitedInfo', {
                        id: this.deleteId,
                    })
                    resident.deleteVisitedInfo(_param).then(res => {
                        if (res.data.code === '0') {
                            this.getVisitedInfoList();
                        }
                    })
                } else if (this.kid === 'dispute') {
                    let _param = this.$tools.invokeUAF('resident/deleteIssueInfo', {
                        id: this.deleteId,
                    })
                    resident.deleteIssueInfo(_param).then(res => {
                        if (res.data.code === '0') {
                            this.getIssueInfoList();
                        }
                    })
                } else {
                    let _param = this.$tools.invokeUAF('subsidyinfo/deleteSubsidyinfo', {
                        id: this.deleteId,
                    })
                    resident.deleteSubsidyinfo(_param).then(res => {
                        if (res.data.code === '0') {
                            this.getSubsidyInfoList();
                        }
                    })
                }
            },

            goDetail(name) {
                this.$tools.goPage_query(name, {familyid: this.familyid})
            },
        },
    };
</script>

<style lang="less" rel="stylesheet/less" type="text/less">
    .page_addmember {
        .baseInfo {
            margin-top: 10px;
        }

        .every-info {
            .info-title {
                height: 1rem;
                line-height: 1rem;
                border-bottom: 1px solid #f4f4f4;
                margin-top: 10px;
                background-color: #fff;

                img {
                    width: .5rem;
                    vertical-align: middle;
                }

                .title-text {
                    width: 85%;
                    text-align: center;
                }
            }

        }

        .item-issue {
            padding-top: 0.5rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid #f4f4f4;
        }
    }
</style>
